﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Routing;

namespace RuoVea.OmiLogin.Attributes;

/// <summary>
/// 
/// </summary>
public class AppRouteAttribute : ApiControllerAttribute, IApiDescriptionGroupNameProvider, IRouteTemplateProvider
{ 
    /// <summary>
    /// {controller=Home}/{action=Index}/{id?}
    /// </summary>
    public string Template
    {
        get
        {
            return PrefixRoute + "/[Controller]";
        }
        set { }
    }

    /// <summary>
    /// 前缀路由地址
    /// </summary>
    public virtual string PrefixRoute { get; set; } = ConfigManages.Config?.PrefixRoute??"";

    /// <summary>
    /// 
    /// </summary>
    public virtual int? Order => 3;
    /// <summary>
    /// 
    /// </summary>
    public virtual string Name => string.Empty;
    /// <summary>
    /// 
    /// </summary>
    public virtual string GroupName => ConfigManages.Config?.GroupName?? "login";
}